package org.rcy.ruicingmarket.interceptor;

import org.apache.commons.lang.StringUtils;
import org.rcy.framework.cache.redis.CommonCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 吴康桥
 * @Description
 * @date 2022/10/26 17:16
 */


public class OssReqInterceptor implements HandlerInterceptor {
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private CommonCache commonCache;
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
		String ossInnerToken = request.getHeader("ossInnerToken");
		if(StringUtils.isBlank(ossInnerToken)) {
			logger.warn("Invalid request");
			return false;
		}
		return true;
	}
}
